﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraBars.Ribbon;
namespace NotebookS2
{
    public partial class CRYSTAL_AR_AGING_PARAM : RibbonForm
    {
        public CRYSTAL_AR_AGING_PARAM()
        {
            InitializeComponent();
        }

        public Form MdiParentForm { get; set; }
        public string ConnectionString { get; set; }

        private void CRYSTAL_AR_AGING_PARAM_Load(object sender, EventArgs e)
        {
            cboDocStatus.SelectedIndex = 0;
            dateEdit1.EditValue = System.DateTime.Now;
            
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {

            CRYSTAL_AR_AGING oForm = new CRYSTAL_AR_AGING();

            oForm.ConnectionString = this.ConnectionString;
            oForm.AsofDate = (DateTime)dateEdit1.EditValue;

            if (cboDocStatus.Text == "Posting Date")
            {
                oForm.IsByDeliveryDate = true;
            }
            else
            {
                oForm.IsByDeliveryDate = false;
            }
            oForm.WindowState = FormWindowState.Maximized;
            oForm.ShowDialog();

            this.Close();

        }
    }
}
